package com.itheima.mapper;

import com.itheima.pojo.entity.Emp;
import com.itheima.pojo.entity.Empexpr;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {
    List<Emp> list(String name, Short gender, LocalDate begin, LocalDate end);
    void deleteList(List<Integer> ids);

    void insert(Emp emp);

//  @Select("select * from emp e left join emp_expr x where e.job = x.job")
    @Select("select * from emp where id = #{id}")
    Emp getById(Integer id);

    void update(Emp emp);

    @Delete("delete from emp where id= #{ids}")
    void delete(Integer ids);


    void addExprList(List<Empexpr> exprList);

    void listExprList(Empexpr empexpr);

    @Select("select * from emp_expr where id = #{id}")
    List<Empexpr> getByEmpExpr(Integer id);
}
